home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / laptop-mode-tools / modules / sched-smt-power-savings < prev    next >
Encoding:
Text File  |  2012-05-20  |  982 b   |  29 lines

  1. #! /bin/sh
  2. # Laptop mode tools module: Scheduler tunables for multi-socket SMT systems.
  3. #
  4.  
  5. if [ x$CONTROL_SCHED_SMT_POWER_SAVINGS = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_SCHED_SMT_POWER_SAVINGS = xauto ]; then
  6.     if [ $ON_AC -eq 1 ]; then
  7.         log "VERBOSE" "On AC power: setting scheduler power saving to 0."
  8.         if [ -w /sys/devices/system/cpu/sched_smt_power_savings ]; then
  9.             echo 0 > /sys/devices/system/cpu/sched_smt_power_savings
  10.             log "VERBOSE" "Scheduler SMT power save mode disabled."
  11.         else
  12.             log "VERBOSE" "Scheduler SMT power saving is not available."
  13.         fi
  14.     else
  15.         log "VERBOSE" "On battery: setting scheduler power saving to 1."
  16.         if [ -w /sys/devices/system/cpu/sched_smt_power_savings ]; then
  17.             echo 2 > /sys/devices/system/cpu/sched_smt_power_savings
  18.             log "VERBOSE" "Scheduler SMT power save mode enabled."
  19.         else
  20.             log "VERBOSE" "Scheduler SMT power saving is not available."
  21.         fi
  22.  
  23.     fi
  24. else
  25.     log "VERBOSE" "Scheduler power setting is disabled."
  26. fi
  27.  
  28.